<div id="maincontent">

<%= render :partial => "shared_common_files/data_area_help_bar" %>

	<% for name in [:simplemsg] %>
    	<% if flash[name] %>
      		<%= "<div class='message-justmsg'> #{flash[name]} </div>" %>
    	<% end %>
  	<% end %>
  
    <% for name in [:notice, :warning, :message] %>
    	<% if flash[name] %>
      		<%= "<div class='message-fatal'> #{flash[name]} </div>" %>
    	<% end %>
  	<% end %>
  	
<%if (params['node'] == "basecamp") %>
	
	<h2>Basecamp > <%=params['name']%> > To-do lists</h2>
	
	<%if (@todolists.length == 1) %> 
		<h5>There are only "<%=@todolists.length%>" to-do list. Which are as follows</h5>
	<%elsif(@todolists.length > 1)%>
		<h5>There are "<%=@todolists.length%>" to-do list. Which are as follows</h5>
	<%elsif(@todolists.length < 1)%>
		<h5>Sorry, there is no to-do list for this project.</h5>
	<%end%>
	
	<%for todolist in @todolists%>
	
	<div class="list">
		<table id="to-do_list">
  			<tr>
				<th><b>Name :</b> <%=todolist.name%> <br/> <b> Description : </b> <%=todolist.description%></th>
				<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<b>Action</b></th>
  			</tr>
  		
			<% count=1;%>	  
			<% rowtype="odd";%>
		
			<% @lists = @conn.get_list(todolist.id)%>
					
<% if (todolist.completed_count == 1 || todolist.uncompleted_count == 1)%>
			
	
			<%if(isodd(count))%>
				<% rowtype="odd";%>
			<%else%>
				<% rowtype="even";%>
			<%end%>  
			
			<tr class="<%=rowtype%>">
				<td width = "70%"><%=@lists.todo_items.todo_item.content%>
				</td>
		 	<td>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 <%if(canRequestLink("integration","saverecord"))%>
					<a href="/integration/saverecord?module=ProjectTask&name=<%=params['name']%>&id=<%=params['id']%>&task=<%=AjubyTools.base64encode(@lists.todo_items.todo_item.content)%>">Export to SugarCRM</a>
					
			 <%end%>
            </td>
		 	</tr>
		 	
		 	<% count = count + 1 %>
			
<%end%>					
			
<% if(todolist.completed_count > 1 || todolist.uncompleted_count > 1) %>
			<%for item in @lists.todo_items %>
	
			<%if(isodd(count))%>
				<% rowtype="odd";%>
			<%else%>
				<% rowtype="even";%>
			<%end%>  
			
			<tr class="<%=rowtype%>">
				<td width = "70%"><%=item.content%>
				</td>
		 	<td>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			 <%if(canRequestLink("integration","saverecord"))%>
					<a href="/integration/saverecord?module=ProjectTask&name=<%=params['name']%>&id=<%=params['id']%>&task=<%=AjubyTools.base64encode(item.content)%>">Export to SugarCRM</a>
					
			 <%end%>
            </td>
		 	</tr>
		 	
		 	<% count = count + 1 %>
			<%end%>
<%end%>			
	

		</table>
	</div>
	<br />
	<%end%>
<%end%>
<br/>
<div class="list">

	<table>
	     <th>Action</th>
         <tr class="even">
            <td>
            <a href="javascript:history.go(-1);"><img src="/themes/odotclassic/images/btn_cancel.gif"/></a>
              
            </td>
         </tr>  
               
	</table>

</div>
</div>